<template>
  <div class="exitExclel">
    <div class="header">
      <div class="btnBox">
        <el-button plain @click="emit('close', state.refresh, props.typeId)">{{ $t("merak.cancel") }}</el-button>
        <el-button type="primary" plain @click="submitForm(ruleFormRef, true)">{{ $t("merak.save_continue") }}</el-button>
        <el-button type="primary" @click="submitForm(ruleFormRef, false)">{{ $t("merak.save") }}</el-button>
    
      </div>
    </div>
    <!-- <div style="display: flex; flex-direction: column;height: 90%;background-color:red;"> -->
     <div v-if="tableBool">
       <!-- <tableCom  v-bind="tableConfig"></tableCom> -->
       <editTable ref="editTableRef" v-bind="tableConfig"></editTable>
    </div>
    <!-- </div> -->
  </div>
</template>
<script setup lang="ts" name="MerakeEditTable">  
import editTable from "@/components/MerakEditTable/components/editTableExcel/index.vue";
import { ref, reactive, defineProps, onMounted, computed,nextTick } from "vue";
const editTableRef=ref(null);
const tableBool=ref(false);
const tableConfig=reactive({
  headData: [], //表格头部数据
  tableData: [], //表格内容数据 
});

const initFiled=()=>{
  
  setTimeout(()=>{
      
     nextTick(()=>{
          let headpp=[{
        key:"spu",
        name:"系统型号",
        type:"input",
        values:[]
      },
      {
        key:"sku",
        name:"系统货号",
        type:"input",
        values:[]
      },
       {
        key:"qifa_color",
        name:"企发颜色",
        type:"select",
        values:[{
          label:"白色",value:"白色"
        },{
          label:"橙色",value:"橙色"
        },{
          label:"粉色",value:"粉色"
        }]
      },
      {
        key:"material_lining",
        name:"里料",
        type:"multiple",
        values:[{
          label:"绒里",value:"绒里"
        },{
          label:"半毛",value:"半毛"
        },{
          label:"真皮",value:"真皮"
        },
        {
          label:"绒里111",value:"绒里111"
        },{
          label:"半毛111",value:"半毛111"
        },{
          label:"真皮111",value:"真皮111"
        }]
      },
       {
        key:"size",
        name:"尺码",
        type:"input",
        values:[]
      },
       {
        key:"other_features",
        name:"其他特点",
        type:"multiple",
        values:[{
          label:"防水",value:"防水"
        },{
          label:"玛丽珍",value:"玛丽珍"
        },{
          label:"宽脚",value:"宽脚"
        },
        {
          label:"带灯",value:"带灯"
        },
        ]
      },
       {
        key:"sku",
        name:"系统货号",
        type:"input",
        values:[]
      },
       {
        key:"sku",
        name:"系统货号",
        type:"input",
        values:[]
      },
        {
        key:"sku",
        name:"系统货号",
        type:"input",
        values:[]
      },
       {
        key:"sku",
        name:"系统货号",
        type:"input",
        values:[]
      },
         {
        key:"sku",
        name:"系统货号",
        type:"input",
        values:[]
      },
       {
        key:"sku",
        name:"系统货号",
        type:"input",
        values:[]
      },
        {
        key:"sku",
        name:"系统货号",
        type:"input",
        values:[]
      },
       {
        key:"sku",
        name:"系统货号",
        type:"input",
        values:[]
      },
      ] 
      tableBool.value=true;
      tableConfig.headData=headpp;//editTableRef.value.handleHeadData();
      let listPP=[{
        _id:"664470fb725470a8ce0e3c33",
        data:{
          spu:{label:"",errTip:"错误错误错误错误"},
          sku:{label:"",errTip:""},
          qifa_color:{label:"",errTip:""},
          material_lining:{label:"错误错误错误错误",errTip:""},
          size:{label:"",errTip:""},
          other_features:{label:"防水,带灯",errTip:"错误错误错误错误"}
        }
      },
      {
        _id:"664470fb725470a8ce0e3c63",
        data:{
          spu:{label:"",errTip:""},
          sku:{label:"",errTip:""},
          qifa_color:{label:"",errTip:""},
          material_lining:{label:"",errTip:""},
          size:{label:"",errTip:""},
          other_features:{label:"",errTip:""}
        }
      }, {
        _id:"664470fb725470a8ce0e3c62",
        data:{
          spu:{label:"",errTip:""},
          sku:{label:"",errTip:""},
          qifa_color:{label:"",errTip:""},
          material_lining:{label:"",errTip:""},
          size:{label:"",errTip:""},
          other_features:{label:"",errTip:""}
        }
      },{
        _id:"664470fb725470a8ce0e3c53",
        data:{
          spu:{label:"",errTip:""},
          sku:{label:"",errTip:""},
          qifa_color:{label:"",errTip:""},
          material_lining:{label:"",errTip:""},
          size:{label:"",errTip:""},
          other_features:{label:"",errTip:""}
        }
      },{
        _id:"664470fb725470a8ce0e3c65",
        data:{
          spu:{label:"4324234234",errTip:"错误错误错误错误"},
          sku:{label:"432423423",errTip:""},
          qifa_color:{label:"432423423",errTip:""},
          material_lining:{label:"半毛",errTip:"错误错误错误错误"},
          size:{label:"432423",errTip:"432423"},
          other_features:{label:"",errTip:""}
        }
      },{
        _id:"664470fb725470a8ce0e3c65",
        data:{
          spu:{label:"4324234234",errTip:"错误错误错误错误"},
          sku:{label:"432423423",errTip:""},
          qifa_color:{label:"432423423",errTip:""},
          material_lining:{label:"半毛",errTip:"错误错误错误错误"},
          size:{label:"432423",errTip:"432423"},
          other_features:{label:"",errTip:""}
        }
      },{
        _id:"664470fb725470a8ce0e3c65",
        data:{
          spu:{label:"4324234234",errTip:"错误错误错误错误"},
          sku:{label:"432423423",errTip:""},
          qifa_color:{label:"432423423",errTip:""},
          material_lining:{label:"半毛",errTip:"错误错误错误错误"},
          size:{label:"432423",errTip:"432423"},
          other_features:{label:"",errTip:""}
        }
      },{
        _id:"664470fb725470a8ce0e3c65",
        data:{
          spu:{label:"4324234234",errTip:"错误错误错误错误"},
          sku:{label:"432423423",errTip:""},
          qifa_color:{label:"432423423",errTip:""},
          material_lining:{label:"半毛",errTip:"错误错误错误错误"},
          size:{label:"432423",errTip:"432423"},
          other_features:{label:"",errTip:""}
        }
      },{
        _id:"664470fb725470a8ce0e3c65",
        data:{
          spu:{label:"4324234234",errTip:"错误错误错误错误"},
          sku:{label:"432423423",errTip:""},
          qifa_color:{label:"432423423",errTip:""},
          material_lining:{label:"半毛",errTip:"错误错误错误错误"},
          size:{label:"432423",errTip:"432423"},
          other_features:{label:"",errTip:""}
        }
      },{
        _id:"664470fb725470a8ce0e3c65",
        data:{
          spu:{label:"4324234234",errTip:"错误错误错误错误"},
          sku:{label:"432423423",errTip:""},
          qifa_color:{label:"432423423",errTip:""},
          material_lining:{label:"半毛",errTip:"错误错误错误错误"},
          size:{label:"432423",errTip:"432423"},
          other_features:{label:"",errTip:""}
        }
      },{
        _id:"664470fb725470a8ce0e3c65",
        data:{
          spu:{label:"4324234234",errTip:"错误错误错误错误"},
          sku:{label:"432423423",errTip:""},
          qifa_color:{label:"432423423",errTip:""},
          material_lining:{label:"半毛",errTip:"错误错误错误错误"},
          size:{label:"432423",errTip:"432423"},
          other_features:{label:"",errTip:""}
        }
      },{
        _id:"664470fb725470a8ce0e3c65",
        data:{
          spu:{label:"4324234234",errTip:"错误错误错误错误"},
          sku:{label:"432423423",errTip:""},
          qifa_color:{label:"432423423",errTip:""},
          material_lining:{label:"半毛",errTip:"错误错误错误错误"},
          size:{label:"432423",errTip:"432423"},
          other_features:{label:"",errTip:""}
        }
      },{
        _id:"664470fb725470a8ce0e3c65",
        data:{
          spu:{label:"4324234234",errTip:"错误错误错误错误"},
          sku:{label:"432423423",errTip:""},
          qifa_color:{label:"432423423",errTip:""},
          material_lining:{label:"半毛",errTip:"错误错误错误错误"},
          size:{label:"432423",errTip:"432423"},
          other_features:{label:"",errTip:""}
        }
      },{
        _id:"664470fb725470a8ce0e3c65",
        data:{
          spu:{label:"4324234234",errTip:"错误错误错误错误"},
          sku:{label:"432423423",errTip:""},
          qifa_color:{label:"432423423",errTip:""},
          material_lining:{label:"半毛",errTip:"错误错误错误错误"},
          size:{label:"432423",errTip:"432423"},
          other_features:{label:"",errTip:""}
        }
      },{
        _id:"664470fb725470a8ce0e3c65",
        data:{
          spu:{label:"4324234234",errTip:"错误错误错误错误"},
          sku:{label:"432423423",errTip:""},
          qifa_color:{label:"432423423",errTip:""},
          material_lining:{label:"半毛",errTip:"错误错误错误错误"},
          size:{label:"432423",errTip:"432423"},
          other_features:{label:"",errTip:""}
        }
      },{
        _id:"664470fb725470a8ce0e3c65",
        data:{
          spu:{label:"4324234234",errTip:"错误错误错误错误"},
          sku:{label:"432423423",errTip:""},
          qifa_color:{label:"432423423",errTip:""},
          material_lining:{label:"半毛",errTip:"错误错误错误错误"},
          size:{label:"432423",errTip:"432423"},
          other_features:{label:"",errTip:""}
        }
      },{
        _id:"664470fb725470a8ce0e3c65",
        data:{
          spu:{label:"4324234234",errTip:"错误错误错误错误"},
          sku:{label:"432423423",errTip:""},
          qifa_color:{label:"432423423",errTip:""},
          material_lining:{label:"半毛",errTip:"错误错误错误错误"},
          size:{label:"432423",errTip:"432423"},
          other_features:{label:"",errTip:""}
        }
      },{
        _id:"664470fb725470a8ce0e3c65",
        data:{
          spu:{label:"4324234234",errTip:"错误错误错误错误"},
          sku:{label:"432423423",errTip:""},
          qifa_color:{label:"432423423",errTip:""},
          material_lining:{label:"半毛",errTip:"错误错误错误错误"},
          size:{label:"432423",errTip:"432423"},
          other_features:{label:"",errTip:""}
        }
      },{
        _id:"664470fb725470a8ce0e3c65",
        data:{
          spu:{label:"4324234234",errTip:"错误错误错误错误"},
          sku:{label:"432423423",errTip:""},
          qifa_color:{label:"432423423",errTip:""},
          material_lining:{label:"半毛",errTip:"错误错误错误错误"},
          size:{label:"432423",errTip:"432423"},
          other_features:{label:"",errTip:""}
        }
      },{
        _id:"664470fb725470a8ce0e3c65",
        data:{
          spu:{label:"4324234234",errTip:"错误错误错误错误"},
          sku:{label:"432423423",errTip:""},
          qifa_color:{label:"432423423",errTip:""},
          material_lining:{label:"半毛",errTip:"错误错误错误错误"},
          size:{label:"432423",errTip:"432423"},
          other_features:{label:"",errTip:""}
        }
      },{
        _id:"664470fb725470a8ce0e3c65",
        data:{
          spu:{label:"4324234234",errTip:"错误错误错误错误"},
          sku:{label:"432423423",errTip:""},
          qifa_color:{label:"432423423",errTip:""},
          material_lining:{label:"半毛",errTip:"错误错误错误错误"},
          size:{label:"432423",errTip:"432423"},
          other_features:{label:"",errTip:""}
        }
      },{
        _id:"664470fb725470a8ce0e3c65",
        data:{
          spu:{label:"4324234234",errTip:"错误错误错误错误"},
          sku:{label:"432423423",errTip:""},
          qifa_color:{label:"432423423",errTip:""},
          material_lining:{label:"半毛",errTip:"错误错误错误错误"},
          size:{label:"432423",errTip:"432423"},
          other_features:{label:"",errTip:""}
        }
      },{
        _id:"664470fb725470a8ce0e3c65",
        data:{
          spu:{label:"4324234234",errTip:"错误错误错误错误"},
          sku:{label:"432423423",errTip:""},
          qifa_color:{label:"432423423",errTip:""},
          material_lining:{label:"半毛",errTip:"错误错误错误错误"},
          size:{label:"432423",errTip:"432423"},
          other_features:{label:"",errTip:""}
        }
      },{
        _id:"664470fb725470a8ce0e3c65",
        data:{
          spu:{label:"4324234234",errTip:"错误错误错误错误"},
          sku:{label:"432423423",errTip:""},
          qifa_color:{label:"432423423",errTip:""},
          material_lining:{label:"半毛",errTip:"错误错误错误错误"},
          size:{label:"432423",errTip:"432423"},
          other_features:{label:"",errTip:""}
        }
      },{
        _id:"664470fb725470a8ce0e3c65",
        data:{
          spu:{label:"4324234234",errTip:"错误错误错误错误"},
          sku:{label:"432423423",errTip:""},
          qifa_color:{label:"432423423",errTip:""},
          material_lining:{label:"半毛",errTip:"错误错误错误错误"},
          size:{label:"432423",errTip:"432423"},
          other_features:{label:"",errTip:""}
        }
      }]
       tableConfig.tableData=listPP;
     })
   
     
  },2000)
}
 

onMounted(() => {
 initFiled()
});
</script>
<style lang="scss" scoped>
.exitExclel{
    height: 100%; 
	display: flex; 
	flex-direction: column; 
	.header {
        width: 100%;
        background-color: #fff;
        padding: 10px 0 20px;
        .btnBox{
            display: flex;
            align-items: center;
            justify-content: end;
        }
    }
    
	 
}
</style>
